#!/usr/bin/env python
from pygame import image
from ImageModifier import split_strip

class ImageLoader:
    def __init__(self):
        self.ground = []
        
    def load(self):      
        temp = split_strip(self.image("Scenery_1/ground.png"), 32, 32, 47)
        self.ground.append(temp)
        
        self.nuke_barrel = split_strip(self.image("Objects/Barrels/nuke_barrel.png"), 64, 64, 7)
        
        self.player_head = self.image("Player/body.png")
        self.player_feet = split_strip(self.image("Player/feet.png"), 24, 24, 2)
        self.player_hands = split_strip(self.image("Player/hands.png"), 20, 19, 2)
        
        self.enemy_body = []
        self.enemy_feet = []
        self.enemy_hands = []
        self.enemy_weapon = []
        for i in range(0, 2):
            self.enemy_body.append(self.image("Enemies/Enemy_"+str(i+1)+"/body.png"))
        
        self.enemy_feet.append(split_strip(self.image("Enemies/Enemy_1/feet.png"), 23, 11, 2))
        self.enemy_feet.append(split_strip(self.image("Enemies/Enemy_2/feet.png"), 24, 8, 2))
        
        self.enemy_hands.append(split_strip(self.image("Enemies/Enemy_1/hands.png"), 17, 17, 2))
        self.enemy_hands.append(split_strip(self.image("Enemies/Enemy_2/hands.png"), 13, 15, 2))
        
        self.enemy_weapon.append(self.image("Enemies/Enemy_1/weapon.png"))
        self.enemy_weapon.append(None)
        
        ##Guns
        self.gun_magnum = self.image("Weapons/Guns/gun_magnum.png")
        self.bullet_magnum = self.image("Weapons/Bullets/bullet_magnum.png")
        
        ##Misc
        self.spikes = self.image("Objects/spikes.png")
        
        ##Pickups
        self.coin = self.image("Objects/Pickups/coin.png")
        
        ##parts
        self.blood = self.image("Particles/blood2.png")
        
    def image(self, file):
        img = image.load("Data/Textures/" + file)
        img.convert()
        return img
